cc.Class({
    extends: cc.Component,

    properties: {
        label: cc.Label,
        normalString: '',
        normalColor: cc.Color,
        disabledString: '',
        disabledColor: cc.Color,
    },
    editor: {
        menu: 'ExtendUI/ButtonLabel',
        requireComponent: cc.Button,
    },

    // use this for initialization
    onLoad: function () {
        this.node.on('click', this.onClick, this);
        this.node.on('click_cancel', this.onClickCancel, this);
    },

    onClick: function() {
        if (this.disabledString) {
            this.label.string = this.disabledString;
        }
        if (this.disabledColor) {
            this.label.node.color = this.disabledColor;
        }
    },

    onClickCancel: function() {
        if (this.normalString) {
            this.label.string = this.normalString;
        }
        if (this.normalColor) {
            this.label.node.color = this.normalColor;
        }
    }
});
